<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('媒资审核记录列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <!--<li>-->
                                <!--<p>媒资ID：</p>-->
                                <!--<input type="text" name="mediaId"/>-->
                            <!--</li>-->
                            <li>
                                <p>视频名称：</p>
                                <input type="text" name="title"/>
                            </li>
                            <li>
                                <p>审核轮次：</p>
                                <select name="auditRound">
                                    <option value="">所有</option>
                                    <option value="0">待审核</option>
                                    <option value="1">一审</option>
                                    <option value="2">二审</option>
                                    <option value="3">三审</option>
                                </select>
                            </li>
                            <li>
                                <p>审核结果：</p>
                                <select name="auditState">
                                    <option value="">所有</option>
                                    <option value="0">待审核</option>
                                    <option value="1">通过</option>
                                    <option value="-1">不通过</option>
                                </select>
                            </li>
                            <!--此处用一审人员字段来模糊查询一、二、三审人员-->
                            <li>
                                <p>审核人员</p>
                                <input type="text" name="oneAuditUser"/>
                            </li>
                            <li class="select-time">
                                <p>一审时间：</p>
                                <input type="text" class="time-input" id="oneAuditStartTime" placeholder="开始时间" name="params[oneAuditBeginTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="oneAuditEndTime" placeholder="结束时间" name="params[oneAuditEndTime]"/>
                            </li>
                            <li class="select-time">
                                <p>二审时间：</p>
                                <input type="text" class="time-input" id="towAuditStartTime" placeholder="开始时间" name="params[towAuditBeginTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="towAuditEndTime" placeholder="结束时间" name="params[towAuditEndTime]"/>
                            </li>
                            <li class="select-time">
                                <p>三审时间：</p>
                                <input type="text" class="time-input" id="threeAuditStartTime" placeholder="开始时间" name="params[threeAuditBeginTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="threeAuditEndTime" placeholder="结束时间" name="params[threeAuditEndTime]"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.table.exportExcel()" shiro:hasPermission="media:mediaAudit:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" data-mobile-responsive="true"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('media:mediaAudit:edit')}]];
        var removeFlag = [[${@permission.hasPermi('media:mediaAudit:remove')}]];
        var prefix = ctx + "media/mediaAudit";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "媒资审核记录",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : '主键',
                    visible: false
                },
                {
                    field : 'vid',
                    title : '媒资vid'
                },
                {
                    field : 'title',
                    title : '媒资名称'
                },
                {
                    field : 'episodeAll',
                    title : '总集数'
                },
                {
                    field : 'auditRound',
                    title : '审核轮次',
                    formatter: function(value, row, index) {
                        if (value == '0') {
                            return '<span class="badge badge-warning-light">待一审</span>';
                        } else if (value == '1') {
                            return '<span class="badge badge-primary">一审完成</span>';
                        }else if (value == '2'){
                            return '<span class="badge badge-primary">二审完成</span>';
                        }else if (value == '3'){
                            return '<span class="badge badge-primary">三审完成</span>';
                        }
                    }
                },
                {
                    field : 'auditState',
                    title : '审核结果 ',
                    formatter: function(value, row, index) {
                        if (value == '0') {
                            return '<span class="badge badge-warning-light">待审核</span>';
                        } else if (value == '1') {
                            return '<span class="badge badge-primary">通过</span>';
                        }else if (value == '-1'){
                            return '<span class="badge badge-danger">不通过</span>';
                        }
                    }
                },
                {
                    field : 'auditFailedReason', 
                    title : '驳回原因'
                },
//                {
//                    field : 'createTime',
//                    title : '推送时间'
//                },
                {
                    field : 'oneAuditUser',
                    title : '一审人员'
                },
                {
                    field : 'oneAuditTime',
                    title : '一审时间',
                    sortable: true
                },
                {
                    field : 'towAuditUser',
                    title : '二审人员'
                },
                {
                    field : 'towAuditTime',
                    title : '二审时间',
                    sortable: true
                },
                {
                    field : 'threeAuditUser',
                    title : '三审人员'
                },
                {
                    field : 'threeAuditTime', 
                    title : '三审时间',
                    sortable: true
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>